<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>md5</title>
    <script src="../static/js/jquery-3.3.1.js"></script>
    <script src="../static/js/jquery.md5.js"></script>
</head>
<body>

<input type="text" id="password">
<input type="hidden" id="encrypted" name="pwd">

<button type="button" id="button">Encrypt</button>

<script>
    $("#button").click(function () {
        var raw = $("#password").val();
        var md5 = $.md5(raw);
        $("#encrypted").attr('value', md5);
        console.log(raw);
        console.log(md5);
    })
</script>

</body>
</html>